<template>
  <view class="goods-item" @click="handleClick">
    <view class="flex items-center justify-between mb-20">
      <view class="flex items-center mr-24 flex-1" @click.stop="handleToCinema">
        <text class="text-999 mr-8 text-row-1">{{ data.cinemaName }}</text>
        <zm-icon name="arrow" color="#999"></zm-icon>
      </view>
      <view class="flex items-center">
        <text class="ml-10">{{ data.showStatusName }}</text>
        <!-- <zm-icon name="clock-o"></zm-icon> -->
        <!-- <u-count-down v-if="data.orderStatus == 0" :time="data.autoTime * 1000" format="mm:ss" @finish="handleOnFinish"></u-count-down> -->
      </view>
    </view>
    <view class="flex items-center">
      <u-image width="140rpx" height="140rpx" radius="12rpx" mode="scaleToFill" :src="data.images[0]"></u-image>
      <view class="ml-20 flex flex-col h-140 justify-between">
        <text class="font-30 font-700 text-row-1">{{ data.goodsName }}</text>
        <text class="text-666">{{ data.goodsSum }}份</text>
        <text class="font-30 font-700 text-price text-price-small-before">{{ data.salePrice | formatDigit({ trimZero: false }) }}</text>
      </view>
    </view>
    <view v-if="data.showStatus == 0" class="flex justify-end mt-24">
      <zm-button round height="54rpx" font-size="26rpx" @click="handleClick">去支付</zm-button>
    </view>
  </view>
</template>

<script>
import hook from "@/mixins/hook"
import weixin from "@/mixins/weixin"
export default {
  mixins: [hook, weixin],
  props: {
    data: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      parent: null
    }
  },
  methods: {
    handleOnFinish() {
      this.$emit("refresh", this.data)
    },
    handleToCinema() {
      this.toView({
        url: `pages/cinema/cinema-schedule/cinema-schedule`,
        params: { cinemaId: this.data.cinemaId }
      })
    },
    handleClick() {
      this.toView({
        url: "pages/order/order-goods-info/order-goods-info",
        params: {
          orderId: this.data.orderId
        }
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.goods-item {
  display: flex;
  padding: 24rpx;
  margin: 20rpx 24rpx;
  margin-bottom: 0;
  border-radius: 16rpx;
  flex-direction: column;
  background-color: #fff;
  .h-140 {
    height: 140rpx;
  }
}
</style>
